package com.tedu.bill.demo2;

/**
 * Author：毕龙
 * Date: 2024/5/24 10:44
 */
public class TestThreadMethodGetName1 {
    public static void main(String[] args) {

       /* Thread t1 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName()+"\t"+i);
            }
        });
        Thread t2 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName()+"\t"+i);
            }
        });
        t1.setName("龙龙");
        t2.setName("子枭");
       t1.start();
        t2.start();*/
        Thread t1 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName()+"\t"+i);
            }
        },"泽豪");
        Thread t2 = new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName()+"\t"+i);
            }
        },"王伟");
        t1.start();
        t2.start();
    }
}
